1: stosl /* low mappings cover as much physmem as possible */
add $4,%edi
add $(1<<L2_PAGETABLE_SHIFT),%eax
- cmp $__HYPERVISOR_VIRT_START+0xe3,%eax
+ cmp $HYPERVISOR_VIRT_START+0xe3,%eax
jne 1b
#else
/* Initialize low and high mappings of all memory with 4MB pages */
jne 1b
1: stosl /* low mappings cover as much physmem as possible */
add $(1<<L2_PAGETABLE_SHIFT),%eax
- cmp $__HYPERVISOR_VIRT_START+0xe3,%eax
+ cmp $HYPERVISOR_VIRT_START+0xe3,%eax
jne 1b
#endif
BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
BUG_ON(sizeof(vcpu_info_t) != 64);
+ /* __foo are defined in public headers. Check they match internal defs. */
+ BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
+#ifdef HYPERVISOR_VIRT_END
+ BUG_ON(__HYPERVISOR_VIRT_END != HYPERVISOR_VIRT_END);
+#endif
+
init_frametable();
end_boot_allocator();
#ifdef CONFIG_X86_PAE
/* Hypervisor owns top 168MB of virtual address space. */
-# define __HYPERVISOR_VIRT_START 0xF5800000
-# define HYPERVISOR_VIRT_START (0xF5800000UL)
+#define HYPERVISOR_VIRT_START mk_unsigned_long(0xF5800000)
#else
/* Hypervisor owns top 64MB of virtual address space. */
-# define __HYPERVISOR_VIRT_START 0xFC000000
-# define HYPERVISOR_VIRT_START (0xFC000000UL)
+#define HYPERVISOR_VIRT_START mk_unsigned_long(0xFC000000)
#endif
#define L2_PAGETABLE_FIRST_XEN_SLOT \
* machine->physical mapping table starts at this address, read-only.
*/
#ifdef CONFIG_X86_PAE
-# define HYPERVISOR_VIRT_START (0xF5800000UL)
+#define __HYPERVISOR_VIRT_START 0xF5800000
#else
-# define HYPERVISOR_VIRT_START (0xFC000000UL)
+#define __HYPERVISOR_VIRT_START 0xFC000000
#endif
+
+#ifndef HYPERVISOR_VIRT_START
+#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
+#endif
+
#ifndef machine_to_phys_mapping
#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
#endif
unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */
} arch_vcpu_info_t;
-#endif
+#endif /* !__ASSEMBLY__ */
#endif
/* And the trap vector is... */
#define TRAP_INSTR "syscall"
+#define __HYPERVISOR_VIRT_START 0xFFFF800000000000
+#define __HYPERVISOR_VIRT_END 0xFFFF880000000000
+
#ifndef HYPERVISOR_VIRT_START
-#define HYPERVISOR_VIRT_START (0xFFFF800000000000UL)
-#define HYPERVISOR_VIRT_END (0xFFFF880000000000UL)
+#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
+#define HYPERVISOR_VIRT_END mk_unsigned_long(__HYPERVISOR_VIRT_END)
#endif
/* Maximum number of virtual CPUs in multi-processor guests. */
typedef uint8_t xen_domain_handle_t[16];
+/* Turn a plain number into a C unsigned long constant. */
+#define __mk_unsigned_long(x) x ## UL
+#define mk_unsigned_long(x) __mk_unsigned_long(x)
+
+#else /* __ASSEMBLY__ */
+
+/* In assembly code we cannot use C numeric constant suffixes. */
+#define mk_unsigned_long(x) x
+
#endif /* !__ASSEMBLY__ */
#endif /* __XEN_PUBLIC_XEN_H__ */
#define __STR(...) #__VA_ARGS__
#define STR(...) __STR(__VA_ARGS__)
+#ifndef __ASSEMBLY__
+/* Turn a plain number into a C unsigned long constant. */
+#define __mk_unsigned_long(x) x ## UL
+#define mk_unsigned_long(x) __mk_unsigned_long(x)
+#else /* __ASSEMBLY__ */
+/* In assembly code we cannot use C numeric constant suffixes. */
+#define mk_unsigned_long(x) x
+#endif /* !__ASSEMBLY__ */
+
#endif /* __XEN_CONFIG_H__ */